﻿
namespace HSS.Xaml.UI.Controls
{
	/// <summary>
	/// A dialog editor.
	/// </summary>
	public interface IEditorDialog
	{
		/// <summary>
		/// Occurs when the IEditorDialog is closed.
		/// </summary>
		event System.EventHandler Closed;
		/// <summary>
		/// Opens a IEditorDialog.
		/// </summary>
		void Show();
		/// <summary>
		/// Close the dialog.
		/// </summary>
		void Close();
		/// <summary>
		/// Ends the current edit operation.
		/// </summary>		
		void EndEdit();
	}

	/// <summary>
	/// The ICancellableEditorDialog interface.
	/// </summary>
	public interface ICancellableEditorDialog : IEditorDialog
	{
		/// <summary>
		/// Gets or sets a value that indicates whether the dialog was accepted or canceled.
		/// </summary>
		/// <returns>true if accepted; false if canceled. The default is null.</returns>
		bool? DialogResult { get; }
	}

	/// <summary>
	/// The IImmutableEditorDialog interface.
	/// </summary>
	public interface IImmutableEditorDialog<T> where T : class
	{
		/// <summary>
		/// Gets the new modified value.
		/// </summary>
		T Value { get; }
	}
}